<?php
/**
 * Links
 *
 * vxor_insert_link($linkdata, $wp_error) 插入链接
 */

extract(get_option('vxor_step'), EXTR_SKIP);

$sLinks = $sdb->get_results("SELECT * FROM {$dbprefix}links ORDER BY id", ARRAY_A);

if ($sLinks){
    foreach( $sLinks as $sLink) {
        $linkdata = array(
            'link_id' => $sLink['id'],
            'link_name' => $sLink['name'],
            'link_url' => $sLink['blogUrl'],
            'link_image' => $sLink['blogLogo'],
            'link_visible' => $sLink['isSidebar'] ? 'Y' : 'N',
            'link_category' => array($sLink['lnkGrpId'] + $last_category_id),
        );

        vxor_insert_link($linkdata, true);
    }
} else {
    return new WP_Error('table_links_error', $sdb->last_query );
}

?>